﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Simulacion.Fruits
{
    class Melon : Fruit
    {
        private double pLowMi, pLowSigma, pJulMi, pJulSigma, pHighAlpha, pHighBeta, pHighGamma;

        public Melon()
        {
            _life = 5;
            this.pLowMi = 0.80881;
            this.pLowSigma = 0.2647;
            this.pJulMi = 1.575;
            this.pJulSigma = 0.37258;
            this.pHighAlpha = 1.9583;
            this.pHighBeta = 1.043;
            this.pHighGamma = 2.3579;

            this._pLowMin = 1.2;
            this._pLowMax = 3.6;
            this._pHighMin = 2.8;
            this._pHighMax = 6.0;
            this._pJulMin = 0.8;
            this._pJulMax = 2.3;
        }

        protected override double GetVarPeriodLow()
        {
            return Distributions.Lognormal3P.GetDistributionValue(_pLowMin, _pLowMax, pLowMi, pLowSigma, 0);
        }

        protected override double GetVarPeriodHigh()
        {
            return Distributions.Frechet.GetDistributionValue(_pHighMin, _pHighMax, pHighAlpha, pHighBeta, pHighGamma);
        }

        protected override double GetVarPeriodJuly()
        {
            return Distributions.Normal.GetDistributionValue(_pJulMin, _pJulMax, pJulMi, pJulSigma);
        }

        protected override double GetFPeriodLow(double x)
        {
            return Distributions.Lognormal3P.fLognormal3P(x, pLowMi, pLowSigma, 0);
        }

        protected override double GetFPeriodHigh(double x)
        {
            return Distributions.Frechet.fFrechet(x, pHighAlpha, pHighBeta, pHighGamma);
        }

        protected override double GetFPeriodJuly(double x)
        {
            return Distributions.Normal.fNormal(x, pJulMi, pJulSigma);
        }

        public double PLowMi
        {
            get { return pLowMi; }
            set { pLowMi = value; }
        }

        public double PLowSigma
        {
            get { return pLowSigma; }
            set { pLowSigma = value; }
        }

        public double PJulMi
        {
            get { return pJulMi; }
            set { pJulMi = value; }
        }

        public double PJulSigma
        {
            get { return pJulSigma; }
            set { pJulSigma = value; }
        }

        public double PHighAlpha
        {
            get { return pHighAlpha; }
            set { pHighAlpha = value; }
        }

        public double PHighBeta
        {
            get { return pHighBeta; }
            set { pHighBeta = value; }
        }

        public double PHighGamma
        {
            get { return pHighGamma; }
            set { pHighGamma = value; }
        }
    }
}
